package com.eliza.workmanager.work

import android.content.Context
import android.util.Log
import androidx.work.Data
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.eliza.workmanager.tools.Tools


class AWork(var context: Context, var workerParams: WorkerParameters) :
    Worker(context, workerParams) {
    override fun doWork(): Result {
        Log.d("ning", this::class.java.simpleName + ": doWork");
        Tools.LogToast(context, this::class.java.simpleName + ": doWork")
        /*
        *  任务执行完之后，返回数据
        * */
        return Result.success(
            Data.Builder()
                .putString("output_data", "执行成功")
                .build()
        );
    }

}